﻿using HalconDotNet;


namespace HalconDemo032401
{
    internal class Program
    {
        static string modelname = "C:\\Users\\Administrator\\Desktop\\Halcon\\Assets\\0324ShapeModel.shm";
        static string filename = "C:\\Users\\Administrator\\Desktop\\Halcon\\Assets\\模板.png";
        static void Main(string[] args)
        {
            HOperatorSet.GenEmptyObj(out HObject image);

            HOperatorSet.ReadImage(out image, filename);

            HOperatorSet.ReadShapeModel(modelname, out HTuple modelID);
             
           
            HTuple hv_Row = new HTuple(), hv_Column = new HTuple();
            HTuple hv_Angle = new HTuple(), hv_Score = new HTuple();
            

            HOperatorSet.FindShapeModel(image, modelID, (new HTuple(0)).TupleRad(),
        (new HTuple(90)).TupleRad(), 0.5, 1, 0.5, "least_squares", 0, 0.9, out hv_Row,
        out hv_Column, out hv_Angle, out hv_Score);


            Console.WriteLine($"匹配分数：{hv_Score.DArr[0]} Row：{hv_Row.DArr[0]} Column：{hv_Column.DArr[0]}");
             

            Console.Read();


        }
    }
}
